/**********************************************************************************************/
/* VClient.h																				  */
/*                                                                       					  */
/* Copyright Paradigma, 1993-2006                                       					  */
/* All Rights Reserved.                                                 					  */
/**********************************************************************************************/

#ifndef _VClient_h
	#define _VClient_h
#pragma once


/**********************************************************************************************/
// This must be always defined for client builds
#ifndef FBL_CLIENT
#	define FBL_CLIENT 1
#endif // FBL_CLIENT


/**********************************************************************************************/
// FBL:
#include <VShared/FBL/publ/Interfaces/FBL_I_Connection.h>
#include <VShared/FBL/publ/Interfaces/FBL_I_Database.h>
#include <VShared/FBL/publ/Interfaces/FBL_I_Location.h>

// VSQL:
#include <VShared/VSQL/Interfaces/VSQL_I_SqlConnection.h>
#include <VShared/VSQL/Interfaces/VSQL_I_ClientInfo.h>
#include <VShared/VSQL/Interfaces/VSQL_I_DatabaseInfo.h>
#include <VShared/VSQL/Interfaces/VSQL_I_Server.h>
#include <VShared/VSQL/Interfaces/VSQL_I_SqlDatabase.h>


/**********************************************************************************************/
FBL_Begin_Namespace


/**********************************************************************************************/
extern ulong gClientCacheSize;	// Defined in bytes


/**********************************************************************************************/
const ulong DEFAULT_CACHE_SIZE = 10 * 1024 * 1024;

const ulong MAX_DATABASE 		= 64;
const ulong MAX_HOSTNAME 		= 128;
const ulong MAX_USER_NAME 		= 32;
const ulong MAX_USER_PASSWORD 	= 64;
const ulong MAX_OPT_LEN 		= 64;
const ulong MAX_CONNSTR 		= 1024;
const ulong MAX_PATH_LEN 		= 512;

const ulong MAX_EVENTNAME_LEN	= MAX_DATABASE;
const ulong MAX_ACTION_LEN 		= MAX_CONNSTR;
const ulong MAX_COMMENT_LEN		= MAX_DATABASE;

/**********************************************************************************************/
							// inClientCacheSize specifies the maximal size of RAM that VClient 
							// can eat on this computer (defined in bytes).
FBL_EXP ulong				ValentinaInitC( 
								ulong 	inClientCacheSize = DEFAULT_CACHE_SIZE );

							// Finalize work with Valentina Client.
FBL_EXP void				ValentinaShutDownC( void );


/**********************************************************************************************/
/*
	This function allow you find all specified Bonjour services.
	inType		- name of service, e.g. "_valentina._tcp"
	inDomain 	- currently NULL or empty string ""
	inSerial 	- serial number that allow to use this function. 
*/	
FBL_EXP ArrayOfStrings_Ptr	LocateBonjourService( 
								const char* inType, 
								const char* inDomain );


/**********************************************************************************************/
FBL_End_Namespace


#pragma mark -

 
/**********************************************************************************************/
VSQL_Begin_Namespace


FBL_EXP I_SqlDatabase*		CreateSqlDatabase(
								I_Connection_Ptr	inConnection );


FBL_EXP VSQL::I_Server*		CreateServer(
								I_Connection_Ptr	inConnection );


/**********************************************************************************************/
VSQL_End_Namespace



/**********************************************************************************************/
#endif // _VClient_h